package com.example.intelligentattendancesystem.controller;

import com.example.intelligentattendancesystem.pojo.Late;
import com.example.intelligentattendancesystem.service.LateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author
 * @version 1.0
 * @className LateController
 * @since 1.0
 */
@RestController
@RequestMapping("smartAttendance/late")
public class LateController {

    @Autowired
    LateService lateService;
    /**
     * 获取迟到信息
     * @param userId
     * @return
     */
    @RequestMapping("/getLate")
    public List<Late> getLate(int userId){
        List<Late> lateService1 = lateService.getLateService(userId);
        return lateService1;
    }

    /**
     * 获取所有迟到的员工
     * @return
     */
    @RequestMapping("/getAllLate")
    public List<Late> getAllLate(){
        List<Late> allLateService = lateService.getAllLateService();
        return allLateService;
    }
}
